/** * SyoTimer v.3.1.0 | under MIT license * https://mrfratello.github.io/SyoTimer */ !function(e){"use strict";function t(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var i=t(jQuery);i.default.syotimerLang={rus:{second:["секунда","секунды","секунд"],minute:["минута","минуты","минут"],hour:["час","часа","часов"],day:["день","дня","дней"],handler:function(e,t){return e%100>4&&e%100<20?t[2]:t[[2,0,1,1,1,2][e%10<5?e%10:5]]}},eng:{second:["second","seconds"],minute:["minute","minutes"],hour:["hour","hours"],day:["day","days"]},por:{second:["segundo","segundos"],minute:["minuto","minutos"],hour:["hora","horas"],day:["dia","dias"]},spa:{second:["segundo","segundos"],minute:["minuto","minutos"],hour:["hora","horas"],day:["día","días"]},heb:{second:["שניה","שניות"],minute:["דקה","דקות"],hour:["שעה","שעות"],day:["יום","ימים"]}};var n="day",a="hour",o="minute",s="second",r={d:n,h:a,m:o,s:s},d={list:[s,o,a,n],next:function(e){var t=this.list.indexOf(e);return t0?this.list[t-1]:null}},l={second:!1,minute:!1,hour:!1,day:!1},u={date:0,layout:"dhms",periodic:!1,periodInterval:7,periodUnit:"d",doubleNumbers:!0,effectType:"none",lang:"eng",headTitle:"",footTitle:"",afterDeadline:function(e){e.bodyBlock.html('

The countdown is finished!

')},itemTypes:["day","hour","minute","second"],itemsHas:i.default.extend({},l)};function c(e){switch(e){case"d":case n:return 86400;case"h":case a:return 3600;case"m":case o:return 60;case"s":case s:default:return 1}}var m=function(e,t){return 1===e?t[0]:t[1]};function h(e,t,i){return($.syotimerLang[t].handler||m)(e,$.syotimerLang[t][i])}var f=function(){function e(e,t){this.element=i.default(e),this.element.data("syotimer-options",t),this.render()}return e.prototype.render=function(){for(var e,t,n,a=this.element.data("syotimer-options"),o=(e=$("
",{class:"syotimer-cell__value",text:"0"}),t=$("
",{class:"syotimer-cell__unit"}),(n=$("
",{class:"syotimer-cell"})).append(e).append(t),n),s=i.default("
",{class:"syotimer__head"}).html(a.headTitle),r=i.default("
",{class:"syotimer__body"}),d=i.default("
",{class:"syotimer__footer"}).html(a.footTitle),l={},u=0;u .syotimer-cell__value",this.element).css("opacity",1);var t=(new Date).getTime(),n=function(e,t){var i,n=e/1e3;if(n=Math.floor(n),!t.periodic)return n;var a=c(t.periodUnit),o=e/(1e3*a);o=Math.ceil(o),o=Math.abs(o),n>=0?(i=0==(i=o%t.periodInterval)?t.periodInterval:i,i-=1):i=t.periodInterval-o%t.periodInterval;var s=n%a;return 0===s&&n<0&&(i-=1),Math.abs(i*a+s)}((e.date instanceof Date?e.date.getTime():e.date)-t,e);if(n>=0)this.refreshUnitsDom(n),this.applyEffectSwitch(e.effectType);else{var a=i.default.extend(this.element,this.element.data("syotimer-blocks"));e.afterDeadline(a)}},e.prototype.refreshUnitsDom=function(e){var t,a,o=this.element.data("syotimer-options"),s=this.element.data("syotimer-items"),r=o.itemTypes,l=function(e){var t=e,i=n,a={day:0,hour:0,minute:0,second:0};do{var o=c(i);a[i]=Math.floor(t/o),t%=o}while(i=d.prev(i));return a}(e);o.itemsHas.day||(l.hour+=24*l.day),o.itemsHas.hour||(l.minute+=60*l.hour),o.itemsHas.minute||(l.second+=60*l.minute);for(var u=0;u